var PID,DivID;
//add ct
function addObj(){
	var divObj=document.getElementById("ctDiv");
	var pObj=divObj.getElementsByTagName("p");
	var pObjOth=document.createElement("p");
	pObjOth.id="ctP"+pObj.length+10000;
	pObjOth.innerHTML="<input type=\"text\" name=\"entity.detail\" title=\"Detailed schedules set\"/><input type=\"hidden\" value=\"must-input\"/>： <input type=\"text\" name=\"entity.startTime\" title=\"Start Time\" class=\"Wdate\" id=\"d414\" onfocus=\"WdatePicker({dateFmt:'HH:mm'})\"/><input type=\"hidden\" value=\"must-input\"/> ~ <input type=\"text\" name=\"entity.endTime\" title=\"End Time\" class=\"Wdate\" id=\"d414\" onfocus=\"WdatePicker({dateFmt:'HH:mm'})\"/><input type=\"hidden\" value=\"must-input\"/> <img src='/SCMDB/images/del.gif' class='delImg' onclick='delLicense(\""+pObjOth.id+"\",\"ctDiv\")' title='Remove the' />";
	divObj.appendChild(pObjOth);	
}

function delLicense(pId,divId){
	if(!document.getElementById(divId)) return false;
	var divObj=document.getElementById(divId);	
	if(!document.getElementById(pId)) return false;
	var pObj=document.getElementById(pId);
	divObj.removeChild(pObj);	
}
function delDetail(pId,divId){
	var div=document.getElementById(divId);
	var p=document.getElementById(pId);
	div.removeChild(p);	
}

function delShiftsDetails(pId,divId,shiftDetailID){
	var parameter = {
			"shiftsDetailID" :shiftDetailID
	}
	var url="/SCMDB/shiftAction!delShiftsDetails.action";
	PID=pId;
	DivID=divId;
	jQuery.post(url, parameter, returnBack);
}
function returnBack(result){
	if(result!=null){
		document.getElementById("showMsg").innerHTML=result;
		delflag=false
	}else{
		document.getElementById("showMsg").innerHTML="";
		delDetail(PID,DivID);
	}
}